home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / eprintf.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  1KB  |  45 lines

  1. #include <stdarg.h>
  2. #include <string.h>
  3. #include <assert.h>
  4. #include "lib.h"
  5.  
  6. /* new file 4/15/92 sb
  7.    This function had to be split from the [vf]printf functions to accommodate
  8.    Sozobon's floating point libs.  Originally, anything that used the assert()
  9.    macro [like malloc()] would pull in this function and bring with it
  10.    definitions of printf et.al.; if we've already included the printf() from
  11.    libm.a, this will cause a conflict.
  12.  
  13.    5/2/92 sb
  14.    Modified to do its own work rather than call fprintf().
  15.  
  16.    5/4/93 uo
  17.    Threw away a static buffer.
  18. */
  19.   
  20. static void _say __PROTO((const char *s));
  21.  
  22. static void _say(s)
  23. const char *s;
  24. {
  25.     _write(2,s,(long)(strlen(s)));
  26. }
  27.  
  28. /* This is used by the `assert' macro.  */
  29. void __eprintf (expression, line, filename)
  30. const char *expression;
  31. const long line;
  32. const char *filename;
  33. {
  34.     char buf[20];
  35.  
  36.     _ltoa(line, buf, 10);
  37.     _say("assertion `");
  38.     _say(expression);
  39.     _say("' failed at line ");
  40.     _say(buf);
  41.     _say(" of file ");
  42.     _say(filename);
  43.     _say("\r\n");
  44. }
  45.